package com.xltt.vehicleControl.model;


import com.xltt.vehicleControl.bean.BaseData;
import com.xltt.vehicleControl.bean.BaseResult;
import com.xltt.vehicleControl.bean.DiagnosticsResponse;
import com.xltt.vehicleControl.bean.PushConfig;
import com.xltt.vehicleControl.bean.RemoteControlRequest;
import com.xltt.vehicleControl.bean.RemoteControlResponse;
import com.xltt.vehicleControl.bean.TcVehicleProfileResponse;
import com.xltt.vehicleControl.bean.TscVehicleCapabilityResponse;
import com.xltt.vehicleControl.bean.UpdateSession;
import com.xltt.vehicleControl.bean.VehicleStatusResponse;
import com.xltt.vehicleControl.contract.IVehicleControlContract;
import com.xltt.vehicleControl.iApiService.IUserService;
import com.xltt.vehicleControl.iApiService.IVehicleControlService;
import com.xltt.vehicleControl.util.RetrofitManager;
import io.reactivex.Observable;
import retrofit2.http.Path;
import retrofit2.http.Query;

public class VehicleControlModel implements IVehicleControlContract.IVehicleControlModel {


    private VehicleControlModel() {

    }

    public static VehicleControlModel getInstance() {
        return Inner.instance;
    }

    @Override
    public Observable<BaseResult<TcVehicleProfileResponse>> getVehicleList(String userId, String type) {
        return RetrofitManager.getInstance().createRs(IVehicleControlService.class).getVehicleList(userId,type);
    }

    @Override
    public Observable<BaseResult<RemoteControlResponse>> remoteControl(String var1, RemoteControlRequest var2) {
        return RetrofitManager.getInstance().createRs(IVehicleControlService.class).remoteControl(var1,var2);
    }

    @Override
    public Observable<BaseResult<VehicleStatusResponse>> getVehicleStatus(String var1, String var2, String var3, String var4) {
        return RetrofitManager.getInstance().createRs(IVehicleControlService.class).getVehicleStatus(var1,var2,var3,var4);
    }

    @Override
    public Observable<BaseResult<TscVehicleCapabilityResponse>> getVehicleCapability(String vin, int pageSize, int pageIndex, int vehicleType, String sortField, String direction) {
        return RetrofitManager.getInstance().createRs(IVehicleControlService.class).getVehicleCapability(vin,pageSize,pageIndex,vehicleType,sortField,direction);
    }

    @Override
    public Observable<BaseResult<BaseData>> logout() {
        return RetrofitManager.getInstance().createRs(IUserService.class).logout();
    }

    @Override
    public Observable<PushConfig> deviceConfig(String deviceId, String appId, String gapp, String appType, String aliPushId, String deviceClass, String modelCode, String pushType) {
        return RetrofitManager.getInstance().createRs(IVehicleControlService.class).deviceConfig(deviceId,appId, gapp, appType, aliPushId, deviceClass, modelCode, pushType);
    }

    @Override
    public Observable<BaseResult<BaseData>> update(String vin, UpdateSession updateSession) {
        return RetrofitManager.getInstance().createRs(IVehicleControlService.class).update(vin,updateSession);
    }


    private static class Inner {
        private static final VehicleControlModel instance = new VehicleControlModel();
    }


}
